package net.ufrog.common.weixin.xpp;

import java.io.Writer;

import com.thoughtworks.xstream.core.util.QuickWriter;
import com.thoughtworks.xstream.io.xml.PrettyPrintWriter;

/**
 * @author ultrafrog
 * @version 1.0, 2014-12-29
 * @since 1.0
 */
public class CdataPrettyPrintWriter extends PrettyPrintWriter {

	/**
	 * @param out
	 */
	public CdataPrettyPrintWriter(Writer out) {
		super(out);
	}
	
	/* (non-Javadoc)
	 * @see com.thoughtworks.xstream.io.xml.PrettyPrintWriter#writeText(com.thoughtworks.xstream.core.util.QuickWriter, java.lang.String)
	 */
	@Override
	protected void writeText(QuickWriter writer, String text) {
		writer.write("<![CDATA[");
		writer.write(text);
		writer.write("]]>");
	}
}
